-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(visualizer): update block colors #1193
Conversation
client/src/app/routes.tsx
Outdated
@@ -43,7 +43,7 @@ import StardustSearch from "./routes/stardust/Search"; | |||
import StardustStatisticsPage from "./routes/stardust/statistics/StatisticsPage"; | |||
import StardustTransactionPage from "./routes/stardust/TransactionPage"; | |||
import { Visualizer as StardustVisualizer } from "./routes/stardust/Visualizer"; | |||
import NovaVisualizer from "../features/visualizer-threejs/VisualizerInstance"; | |||
import NovaVisualizerWrapper from "../features/visualizer-threejs/NovaVisualizerWrapper"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use NovaVisualizer
name instead of NovaVisualizerWrapper
?
Seems it could be more convenient according to names on this page.
Could we create in folder features/visualizer-threejs
file like index.ts and make all exports from this file? It will look like all what exported from index.ts
is like public. What not exported only for internal using.
And maybe we could rename
NovaVisualizerWrapper.tsx → NovaVisualizer.tsx
In file client/src/features/visualizer-threejs/NovaVisualizerWrapper.tsx
from import NovaVisualizer from "./VisualizerInstance";
to import VisualizerInstance from "./VisualizerInstance";
Not requirement, just discussion.
What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I updated the file name and made a new task for the store refactor:
#1196
blockIdToState: Map<BlockId, BlockState>; | ||
setBlockIdToBlockState: (blockId: BlockId, blockState: BlockState) => void; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed that we have a lot of data that related to blockId.
And usually when we need to remove block, we need to go through all maps, like:
blockIdToIndex, blockIdToEdges, blockIdToPosition, blockMetadata, blockIdToAnimationPosition, blockIdToState.
Maybe it's a good sign to:
- Store all of this mappers one under another.
blockIdToIndex: Map<string, number>;
blockIdToEdges: Map<string, EdgeEntry>;
blockIdToPosition: Map<string, [x: number, y: number, z: number]>;
blockIdToMetadata: Map<string, IFeedBlockData & { treeColor: Color }>; // rename it from blockMetadata
blockIdToAnimationPosition: Map<string, IBlockAnimationPosition>;
blockIdToState: Map<BlockId, BlockState>;
- Create function for clear all dependent mapper's data at once.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Created a new issue for this:
#1196
const previousBlockId = state.indexToBlockId[index]; | ||
if (previousBlockId) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, I see. Maybe this is something that I was talking about in comment above.
…:iotaledger/explorer into feat/nova-visualizer/update-block-colors
Description of change
Fixes #1181
Type of change
How the change has been tested
Describe the tests that you ran to verify your changes.
Make sure to provide instructions for the maintainer as well as any relevant configurations.
Change checklist
Add an
x
to the boxes that are relevant to your changes, and delete any items that are not.